using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Framework.Library.Utilities.Database;
using Framework.Library;
using Framework.Library.Components.Security;

namespace Framework.Portal.Administrator.SystemInfomation.Database
{
    public partial class Infomation : AuthenticatedControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {                                 
            lblCommandName.Text = AppEnv.CommandName();
            dtgInfos.DataSource = Info.GetVersion();
            dtgInfos.DataBind();
            rptConfiguration.DataSource = Info.GetConfiguration();
            rptConfiguration.ItemDataBound +=new RepeaterItemEventHandler(rptConfiguration_ItemDataBound);
            rptConfiguration.DataBind();
        }

        private void rptConfiguration_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                Label myLabel;
                myLabel = (Label)e.Item.FindControl("lblStatus");
                DataRowView rowView = (DataRowView)e.Item.DataItem;

                if (rowView != null)
                {

                    switch (rowView["status"].ToString())
                    {
                        case "0":
                            myLabel.Text = "Static";
                            break;
                        case "1":
                            myLabel.Text = "Dynamic";
                            break;
                        case "2":
                            myLabel.Text = "Advance";
                            break;
                        case "3":
                            myLabel.Text = "Dynamic & Advance";
                            break;
                    }
                }
            }
        }        
    }
}